package org.vergil.core.designpattern.state.Lift;

/**
 * Created by vergil on 17-3-25.
 */
public class RunningState extends LiftState {

    public RunningState(LiftState state){
        this.context = state.context;
    }

    @Override
    public void open() {
        System.out.println("运行中不能开门...");
    }

    @Override
    public void close() {

    }

    @Override
    public void run() {
        System.out.println("电梯门上下运行...");
    }

    @Override
    public void stop() {
        context.setLiftState(Context.stoppingState);
        context.getLiftState().stop();
    }
}
